package edu.berkeley.guir.webquilt.proxy;

import com.arthurdo.parser.*;
import edu.berkeley.guir.webquilt.*;

/**
 * Abstract version of HTML Tag Editor
 *
 * <P>
 * This software is distributed under the
 * <A HREF="http://guir.cs.berkeley.edu/projects/COPYRIGHT.txt">
 * Berkeley Software License</A>.
 *
 * <PRE>
 * Revisions:  - WebQuilt-v1.0-1.0.0, Feb 21 2001, jheer
 *               Created interface
 *             - WebQuilt-v1.0.0-2.0.1, Jan 14 2002, kaow
 *               HTMLAbstractEditor and WMLAbstract editor now both inherit from
 *               AbstractEditor
 * </PRE>
 *
 * This class utilizes the HtmlStreamTokenizer package from Arthur Do Consulting.<BR>
 *
 * @author  Jeffrey Heer (
 *          <A HREF="mailto:jheer@hkn.eecs.berkeley.edu">jheer@hkn.eecs.berkeley.edu</A>
 *          )
 * @author  Wayne Kao (
 *          <A HREF="mailto:kaow@cs.berkeley.edu">kaow@cs.berkeley.edu</A>
 *          )
 * @since   JDK 1.3
 * @version WebQuilt-v1.0.0-2.0.1, Jan 14 2002
 */
abstract class HTMLAbstractEditor extends AbstractEditor implements TagEditor {

    HTMLProxyEdit     proxy;

    /**
     * This edits the given HtmlTag. This should be
     *  implemented by subclasses if you would like
     *  to perform any tag editing.
     * @param tag the HTML tag to edit
     */
    public String editTag(HtmlTag tag) {
	return ( tag.toString() );
    } //

    /**
     * Register this editor with the proxy editor.
     *  This should not be overridden by subclasses.
     * @param HTMLProxyEdit the HTMLProxyEdit instance to reigster with.
     */
    public void register(ProxyEdit proxyEdit) {
	proxy = (HTMLProxyEdit)proxyEdit;
    } //


    /**
     * TagEditor initialization. This should not be
     *  implemented by any subclasses. Instead use
     *  reset().
     */
    public void init() {
	entry = proxy.entry;
	reset();
    } //

} // of class

//==============================================================================

/*
Copyright (c) 2001 Regents of the University of California.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.

3. All advertising materials mentioning features or use of this software
   must display the following acknowledgement:

      This product includes software developed by the Group for User
      Interface Research at the University of California at Berkeley.

4. The name of the University may not be used to endorse or promote products
   derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
